package old2.Map;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        String line = "Thinking in Java!i love java!";
        HashMap<Object, Integer> map = new HashMap<>();
        for (int i = 0; i <line.length(); i++) {
            char c = line.charAt(i);
            if (!map.containsKey(c)){
                map.put(c,1);
            }else {
               int a=map.get(c);
               map.put(c,++a);
            }
        }
        System.out.println(map);
    }
}
